{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "9704ba40-7199-4f43-9dca-5b583c696b2d",
   "metadata": {},
   "source": [
    "Chapter 08\n",
    "# 函数complex() 的位置参数、关键字参数\n",
    "Book_1《编程不难》 | 鸢尾花书：从加减乘除到机器学习 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "40dbfe16-0086-489b-8b1a-00f02b35e318",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4+3j)"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 位置参数\n",
    "complex(4, 3)\n",
    "# (4+3j)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "c24fe465-c00e-481c-b442-3f88a749a598",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(3+4j)"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "complex(3, 4)\n",
    "# (3+4j)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "35d5c870-f560-42b8-af78-2b6e7dc8e806",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(3+4j)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 关键字参数\n",
    "complex(real=3, imag=4)\n",
    "# (3+4j)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "941b521a-0278-463c-b628-4b089a95b06f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(3+4j)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "complex(imag=4, real=3)\n",
    "# (3+4j)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
